<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="../templates/default3.xhtml">        
            <ui:define name="content">
                <h:form id="searchProductionBatch" binding="#{productionBatchManagerBean.loadSearchProductionBatch}">
                 <p:messages id="error"/>
                    <p:panel header="Select Production Batch" id="selectProductionBatch">


                     <p:dataTable id="productionBatches" var="productionBatch" value="#{productionBatchManagerBean.productionBatches}" selectionMode="single" 
                                     selection="#{productionBatchManagerBean.productionBatch}" update ="productionBatches" paginator="true" rows="6"  
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" >

                         <p:column  headerText="Production Date" >  
                                <center><h:outputText value="#{productionBatch.productionDate}" /> </center> 
                            </p:column> 
                         
                          <p:column  headerText="Product" >  
                                <center><h:outputText value="#{productionBatch.product.name}" /> </center> 
                            </p:column> 
                         
                            <p:column  headerText="Product" >  
                                <center><h:outputText value="#{productionBatch.product.name}" /> </center> 
                            </p:column> 

                            <p:column  headerText="Quantity" >  
                                <center><h:outputText value="#{productionBatch.quantity}" /> </center> 
                            </p:column> 
                            <p:column  headerText="Type" >  
                                <center><h:outputText value="#{productionBatch.productionScheduleDay.type}" /> </center> 
                            </p:column> 
                            <p:column  headerText="Remark" >  
                                <center><h:outputText value="#{productionBatch.remark}" /> </center> 
                            </p:column> 


                        </p:dataTable>



                    </p:panel>

                    <table class="table-submit">
                        <tr>
                            <td align="center">
                                <p:commandButton value="Select Production Batch" actionListener="#{productionBatchManagerBean.selectProductionBatch}" ajax="true" update="error"/>
                            </td>
                        </tr>
                    </table>

                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
